﻿using System;

namespace NavigationCoercion
{
    internal static class ExtensionMethods
    {
        internal static string GetPossibleXamlPagePath(this Type type)
        {
            // This methods seems rather dirty :( Feel free to change it if smth doesn't work for you.

            var shortAssemblyName = type.Assembly.FullName.Substring(0, type.Assembly.FullName.IndexOf(","));
            var typeName = type.FullName.Remove(0, shortAssemblyName.Length);
            typeName = typeName.Replace(".", "/");
            
            return typeName + ".xaml";
        }
    }
}
